package com.auxgroup.smarthome.inner.service;

import com.auxgroup.bridge.app.inner.dto.DeviceConnectFailDto;
import com.auxgroup.smarthome.BeanUtils;
import com.auxgroup.smarthome.inner.entity.DeviceConnectFailEntity;
import com.auxgroup.smarthome.inner.repo.DeviceConnectFailRepo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * Created by lixiaoxiao on 17-7-31.
 */
@Service
public class DeviceConnectFailService {
    @Autowired
    private DeviceConnectFailRepo deviceConnectFailRepo;

    public boolean saveConnectFail(DeviceConnectFailDto deviceConnectFailDto) {
        DeviceConnectFailEntity deviceConnectFailEntity = new DeviceConnectFailEntity();
        BeanUtils.copyAttrs(deviceConnectFailEntity, deviceConnectFailDto);
        deviceConnectFailRepo.save(deviceConnectFailEntity);
        return true;
    }
}
